/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mx.saco.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author jethro.gutierrez
 */
@Entity
@Table(name = "tt_pagina_xhtml_padre")
@NamedQueries({
    @NamedQuery(name = "PaginaXhtmlPadre.findAll", query = "SELECT p FROM PaginaXhtmlPadre p"),
    @NamedQuery(name = "PaginaXhtmlPadre.findByIdPaginaPadre", query = "SELECT p FROM PaginaXhtmlPadre p WHERE p.idPaginaPadre = :idPaginaPadre"),
    @NamedQuery(name = "PaginaXhtmlPadre.findByPValue", query = "SELECT p FROM PaginaXhtmlPadre p WHERE p.label = :label"),
    @NamedQuery(name = "PaginaXhtmlPadre.findByPIcon", query = "SELECT p FROM PaginaXhtmlPadre p WHERE p.icon = :pIcon"),
    @NamedQuery(name = "PaginaXhtmlPadre.findByPCommand", query = "SELECT p FROM PaginaXhtmlPadre p WHERE p.command = :pCommand")})
public class PaginaXhtmlPadre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_pagina_padre")
    private Integer idPaginaPadre;
    @Column(name = "p_value")
    private String label;
    @Column(name = "p_icon")
    private String icon;
    @Column(name = "p_update")
    private String update;
    @Column(name = "p_command")
    private String command;
    @OneToMany(mappedBy = "idPaginaPadre")
    private List<PaginaXhtml> paginaXhtmlList;

    public PaginaXhtmlPadre() {
    }

    public PaginaXhtmlPadre(Integer idPaginaPadre) {
        this.idPaginaPadre = idPaginaPadre;
    }

    public Integer getIdPaginaPadre() {
        return idPaginaPadre;
    }

    public void setIdPaginaPadre(Integer idPaginaPadre) {
        this.idPaginaPadre = idPaginaPadre;
    }

   
   

    
	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public List<PaginaXhtml> getPaginaXhtmlList() {
		return paginaXhtmlList;
	}

	public void setPaginaXhtmlList(List<PaginaXhtml> paginaXhtmlList) {
		this.paginaXhtmlList = paginaXhtmlList;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (idPaginaPadre != null ? idPaginaPadre.hashCode() : 0);
        return hash;
    }

   

	public String getUpdate() {
		return update;
	}

	public void setUpdate(String update) {
		this.update = update;
	}

	public String getCommand() {
		return command;
	}

	public void setCommand(String command) {
		this.command = command;
	}

	@Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaginaXhtmlPadre)) {
            return false;
        }
        PaginaXhtmlPadre other = (PaginaXhtmlPadre) object;
        if ((this.idPaginaPadre == null && other.idPaginaPadre != null) || (this.idPaginaPadre != null && !this.idPaginaPadre.equals(other.idPaginaPadre))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mx.saco.entity.PaginaXhtmlPadre[ idPaginaPadre=" + idPaginaPadre + " ]";
    }
    
}
